package com.edgar.music.artist.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.view.View;
import android.view.ViewGroup;

import com.edgar.music.R;
import com.edgar.music.artist.entity.ArtistCategory;
import com.edgar.music.base.BaseAdapterHelper;
import com.edgar.music.base.MusicAdapter;

/**
 * Created by Edgar on 2017/1/2.
 * 歌手分类适配器
 */
public class ArtistCategoryListAdapter extends MusicAdapter<ArtistCategory>{
    public ArtistCategoryListAdapter(Context context) {
        super(context);
    }

    @NonNull
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ArtistCategory artistCategory = getItem(position);
        BaseAdapterHelper baseAdapterHelper = BaseAdapterHelper.get(getContext(),convertView,parent, R.layout.artist_category_list_item);
        if (artistCategory != null){
            baseAdapterHelper.setText(R.id.category_name,artistCategory.getTitle());
            baseAdapterHelper.setVisible(R.id.category_indicator,artistCategory.isSelect());
        }
        return baseAdapterHelper.getView();
    }
}